package com.carrier.springboot.service.impl;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.carrier.springboot.entity.User;
import com.carrier.springboot.mapper.UserMapper;
import com.carrier.springboot.service.IUserService;
import com.github.pagehelper.PageHelper;

@Service
public class UserServiceImpl implements IUserService {

	@Autowired
	private UserMapper userMapper;

	@Override
	public User selectUserById(Integer id) {
		return userMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<User> findAll(int pageNum, int pageSize) {
		PageHelper.startPage(pageNum, pageSize);
		return userMapper.findAll();
	}

	@Override
	public String getPasswordByUsername(String username) {
		return userMapper.findPasswordByName(username);
	}

}
